//
//  JMNewsController.m
//  仿生物无忧
//
//  Created by 彭继宗 on 15/12/5.
//  Copyright © 2015年 彭继宗. All rights reserved.
//

#import "JMNewsController.h"

#import "JMTechnicTableViewController.h"

#import "JMshowTableViewController.h"

#import "JMLatestTableViewController.h"

@interface JMNewsController ()

@end

@implementation JMNewsController

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    
    [self prepareView];
    
}

/**
 *  准备页面
 */
- (void)prepareView
{
    
    self.tabedSlideView.baseViewController = self;
    self.tabedSlideView.tabItemNormalColor = [UIColor colorWithWhite:0.5 alpha:1];
    self.tabedSlideView.tabItemSelectedColor = basicColor;
    self.tabedSlideView.tabbarTrackColor = basicColor;
    
    self.tabedSlideView.tabbarBottomSpacing = 10.0;
    
    DLTabedbarItem *item1 = [DLTabedbarItem itemWithTitle:@"最新资讯" image:[UIImage imageNamed:@"goodsNew"] selectedImage:[UIImage imageNamed:@"goodsNew_d"]];
    DLTabedbarItem *item2 = [DLTabedbarItem itemWithTitle:@"技术大全" image:[UIImage imageNamed:@"goodsHot"] selectedImage:[UIImage imageNamed:@"goodsHot_d"]];
    DLTabedbarItem *item3 = [DLTabedbarItem itemWithTitle:@"会展中心" image:[UIImage imageNamed:@"goodsPrice"] selectedImage:[UIImage imageNamed:@"goodsPrice_d"]];
    self.tabedSlideView.tabbarItems = @[item1, item2, item3];
    [self.tabedSlideView buildTabbar];
    self.tabedSlideView.selectedIndex = 0;

}
/**
 *  返回数组
 *
 */
- (NSInteger)numberOfTabsInDLTabedSlideView:(DLTabedSlideView *)sender
{
    return 3;
}

- (UIViewController *)DLTabedSlideView:(DLTabedSlideView *)sender controllerAt:(NSInteger)index
{
    switch (index)
    {
        case 0:
        {
            JMLatestTableViewController *latestVC = [[JMLatestTableViewController alloc] init];
            
            return latestVC;
        }
        case 1:
        {
            JMTechnicTableViewController *technicVC = [[JMTechnicTableViewController alloc] init];
            
            return technicVC;
        }
        case 2:
        {
            JMshowTableViewController *showVC = [[JMshowTableViewController alloc] init];
            
            return showVC;
        }
            
        default:
            return nil;
    }
}



@end
